/**
 * <pre>
 * Title: 		AbstractAutoIdEntity.java
 * Author:		linriqing
 * Create:	 	2010-7-6 上午11:40:21
 * Copyright: 	Copyright (c) 2010
 * Company:		Shenzhen Helper
 * <pre>
 */
package com.hengpeng.common.persist.entity;

import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.MappedSuperclass;

import com.hengpeng.common.persist.OperateLogListener;
import com.hengpeng.common.web.annotation.HtmlInput;
import com.hengpeng.common.web.annotation.HtmlInputType;

/**
 * <pre>
 * 包含自增主键的实体类型抽象类,如果不要自增,可以不用继承改基类
 * </pre>
 * @author linriqing
 * @version 1.0, 2010-7-6
 */
@MappedSuperclass
@Inheritance(strategy = InheritanceType.JOINED)
@EntityListeners(OperateLogListener.class)
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
public abstract class AbstractAutoIdEntity extends AbstractEntity
{
	private static final long serialVersionUID = 6757814772463743205L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@HtmlInput(type = HtmlInputType.AUTOID)
	private Long id;

	public Long getId()
	{
		return id;
	}

	public void setId(Long id)
	{
		this.id = id;
	}
}
